package org.opens.sql.constant;

/**
 * 控制生成mapper和dao的模式
 *
 * @author by zhangyuming
 * @date 2022/9/27
 */
public enum GenMapperMode {

    MYBATIS("MYBATIS", "使用mybatis生成模式!"),
    MYBATIS_PLUS("MYBATIS_PLUS", "使用mybatis_plus生成模式!"),
    EMPTY("", "空生成模式"),
    JPA("JPA", "使用jpa生成模式!");

    private String value;

    private String desc;

    GenMapperMode(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getValue() {
        return value;
    }

    public static GenMapperMode getInstance(String value) {
        for (GenMapperMode genMapperMode : GenMapperMode.values()) {
            if (genMapperMode.getValue().equals(value)) {
                return genMapperMode;
            }
        }
        return EMPTY;
    }


}
